home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 1
/
001.d81
/
dynamic renew.b
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
98 lines
1000 :
1010 rem dynamic renewing program
1020 rem t.s. creasy september 1983
1030 :
1040 rem instructions
1050 :
1051 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]":print"[221]dynamic renew disk [221]"
1052 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
1053 forx=1to1000:next
1060 print"this program modifies":print"itself by the dynamic"
1070 print"keyboard technique.":print"once modified, it "
1080 print"cannot be used with ":print"any disk except the one"
1090 print"it was modified for.":print"during the dynamic"
1100 print"modification the screen":print"will flash with"
1110 print"the new program lines":open50,0:print"press return":input#50,k$:close50
2000 :
2010 rem attach data statements
2020 rem of tracks and sectors
2030 :
2032 print"[147]5 data"peek(822)
2033 print"goto2050"
2034 poke631,13:poke632,13:rem poke carriage returns into k buffer
2035 poke198,2:rem number of returns
2036 stop
2050 i=0:ln=10:j=peek(822)
2060 print"[147]"(ln+i)"data"peek(823+i)","peek(823+i+j)
2070 print"goto2120"
2080 poke631,13:poke632,13:rem poke carriage returns into k buffer
2090 poke198,2:rem number of returns
2100 poke820,i:rem save i in c buffer
2105 poke821,ln:rem save ln in c buffer
2110 stop
2120 i=peek(820)+1:ln=peek(821)+1:j=peek(822)
2130 if i<peek(822)then2060
3000 :
3010 rem force skip to validate
3020 rem portion of the program
3030 :
3040 print"[147]1 goto 4000":print"goto6000"
3060 poke631,13:poke632,13:rem poke carriage return into k buffer
3080 poke198,2:rem number of returns
3090 stop
4000 :
4010 rem new disk with operator
4020 rem interaction
4030 :
4040 print"[147][176][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][174]"
4050 print"[209] renew disk [209]"
4060 print"[209] bad sectors [209]"
4070 print"[173][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][189]"
4080 print"insert disk in drive":print"press return"
4090 open50,0:input#50,k$:close50
4100 print"initializing disk"
4110 open15,8,15,"i":input#15,e,m$,tr,se
4115 open5,8,5,"#": rem open buffer
4120 ife<>0thenprint"disk error#"e:end
4130 print#15,"b-r:"5;0;18;0:rem place disk header in buffer #
4140 print#15,"b-p:"5;144:rem set pointer to disk name
4150 d$="":forx=144to166:get#5,k$:d$=d$+(chr$(0)+k$):next:rem disk name
4160 print"disk name:":print""d$
4170 input"renew disk (erasing all files)[146] n[146][157][157][157]";k$
4180 ifk$<>"y"thenclose5:close15:end
4190 input"enter new name";k$
4200 print"name:"k$:input"is name correct y[146][157][157][157]";a$
4210 ifa$<>"y"then4190
4220 print#15,"n0:"k$:print"newing disk"
4998 close5:close15
5000 :
5010 rem allocate bad blocks
5020 :
5030 open15,8,15,"v":print"[147]validating the disk"
5040 open2,8,2,"#"
5050 print"[147] bad blocks":print"track","sector"
5060 read j:i=0
5070 read tr,se
5080 print#15,"b-a:";0;tr;se
5090 printtr,se
5100 i=i+1:if i=j then 5120
5110 goto5070
5120 forx=1to3000:next
5130 print"[147]"j"bad sectors have":print"been removed from use."
5140 print"do not validate ":print"data may be lost!"
5150 close15
5160 forx=1to1000:next
6000 :
6010 rem save self to disk
6020 :
6030 print"[147]place disk with bad":print"blocks in drive"
6040 open50,0:print"press return":input#50,k$
6050 print"saving this program"
6060 save"@0:renew this disk",8
6080 print"[147]never validate this":print"disk. copy files to ":print"another disk, then"
6090 print"load and run this":print"program to renew the":print"disk with automatic"
6100 print"'bad sector' handling.":print"never validate this disk"
6110 print"this program has been":print"modified for this":print"disk only"
6120 print"do not use this ":print"program with another":print"disk:::: "
7110 print"the disk is prepared"